<script setup lang="ts">
import {RouterView, useRouter, useRoute} from 'vue-router'
import { userStore } from './stores/counter'
import { watch } from 'vue';

const store = userStore()
const route = useRoute()

// store.getUserInfo()

watch(
  // 监听对象具体的某个属性
  () => route.name,
  () => {
    if(route.name !== 'login') {
      store.getUserInfo()
    }
  },
  {
    once: true
  }
)


</script>

<template>
  <RouterView />
</template>

<style scoped>

</style>
